import { Form, Select, Switch, Checkbox } from 'antd';
import Strategy from '../components/Strategy';

export default function Advance(props: any) {
    const { form } = props;
    const automaticUrgeValue = Form.useWatch(['senior', 'automaticUrge'], form);

    return (
        <>
            <Form.Item label='自动审批规则' name={['senior', 'jumpRule']} className='bpmn-custom-properties-radio-wrap'>
                <Checkbox.Group
                    options={[
                        { value: 'samePrevStartActSkip', label: '所有发起人合并（所有节点中审批人为发起人时，自动审批）' },
                        { value: 'samePrevActSkip', label: '相邻审批人合并（相邻节点的审批人相同时，自动审批）' },
                        { value: 'samePrevAllActSkip', label: '所有审批人合并（所有节点中审批人相同时，自动审批）' },
                    ]}
                />
            </Form.Item>
            <Form.Item label='超时处理策略' name={['senior', 'automaticUrge']}>
                <Select
                    options={[
                        // { value: '', label: '无' },
                        { value: true, label: '消息通知' },
                        // { value: '2', label: '自动同意' },
                        // { value: '3', label: '自动拒绝' },
                    ]}
                    allowClear={true}
                />
            </Form.Item>
            {
                automaticUrgeValue
                &&
                <Form.Item label='超时通知策略' name={['senior', 'automaticIntervar']}>
                    <Strategy />
                </Form.Item>
            }
            <div style={{ fontSize: 14, fontWeight: 'bold', color: '#333', marginBottom: 15 }}>消息通知</div>
            <Form.Item label='任务到达通知' name={['senior', 'isPushReachMsg']} valuePropName='checked'>
                <Switch />
            </Form.Item>
            <Form.Item label='任务待领通知' name={['senior', 'isPushCandidateMsg']} valuePropName='checked'>
                <Switch />
            </Form.Item>
            <Form.Item label='任务指派通知' name={['senior', 'isPushAssignMsg']} valuePropName='checked'>
                <Switch />
            </Form.Item>
            <Form.Item label='任务退回通知' name={['senior', 'isPushReturnMsg']} valuePropName='checked'>
                <Switch />
            </Form.Item>
            <Form.Item label='任务超时通知' name={['senior', 'isPushTimeOutMsg']} valuePropName='checked'>
                <Switch />
            </Form.Item>
            <Form.Item label='任务催办通知' name={['senior', 'isPushUrgingMsg']} valuePropName='checked'>
                <Switch />
            </Form.Item>
            <Form.Item label='流程终止通知' name={['senior', 'isPushCancelMsg']} valuePropName='checked'>
                <Switch />
            </Form.Item>
            <Form.Item label='流程结束通知' name={['senior', 'isPushEndMsg']} valuePropName='checked'>
                <Switch />
            </Form.Item>
        </>
    );
};
